package com.gzist.blog_system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Author: 黄泽建
 * @TableName t_comment
 */
@TableName(value ="t_comment")
@Data
@ApiModel("文章评论模块")
public class Comment implements Serializable {
    /**
     * 评论id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty("评论id")
    private Long id;

    /**
     * 评论关联的文章id
     */
    @TableField(value = "article_id")
    @ApiModelProperty("评论关联的文章id")
    private Long articleId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 评论用户所在ip
     */
    @TableField(value = "ip")
    @ApiModelProperty("评论用户所在ip")
    private String ip;

    /**
     * 评论内容
     */
    @TableField(value = "content")
    @ApiModelProperty("评论内容")
    private String content;

    /**
     * 评论状态
     */
    @TableField(value = "status")
    @ApiModelProperty("评论状态")
    private String status;

    /**
     * 评论作者名
     */
    @TableField(value = "author")
    @ApiModelProperty("评论作者名")
    private String author;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}